class FeedSyndicatorJob {

  def feedCollectorService
  def startDelay = 60001 // wait 1 minute before starting feed syndication  
  def timeout = 60000l // execute job once in 60 seconds
  def concurrent = false

  private static updating = false

  def execute() {
    if (!updating) {
      updating = true
      log.info "Collecting Messages from feeds..."
      feedCollectorService.updateAllFeeds()
      updating = false
    } else {
      log.warn("Skipping Feed update. Previous job in progress")
    }
  }
}
